﻿using Adventure.Server.Library;

namespace Adventure.Server.Data
{
    /// <summary>
    /// Adapter to load / save SavedObjects.
    /// </summary>
    public interface IDataAdapter
    {
        /// <summary>
        /// Sets the Source of DataAdapter
        /// </summary>
        /// <param name="source">Source string. Content depends on data adapter an might be a path or a connection string.</param>
        void SetSource(string source);

        /// <summary>
        /// Gets the Object Attributes of an object.
        /// </summary>
        /// <param name="id">Id of the object.</param>
        /// <returns></returns>
        ObjectAttributes GetObjectAttributes(string id);

        /// <summary>
        /// Save the given object attriutes.
        /// </summary>
        /// <param name="attributes"></param>
        void SaveObjectAttributes(ObjectAttributes attributes);

        /// <summary>
        /// Delete the object with the given id.
        /// </summary>
        /// <param name="id">Id of object to delete.</param>
        void Delete(string id);
    }
}
